package stmo.树.二叉树;

/**
 *  二叉树测试类
 */

public class BinaryTreeTest {

    public static void main(String[] args) {

        BinaryTree<Integer,String> binaryTree = new BinaryTree<>();

        //测试插入
        binaryTree.put(18,"1");
        binaryTree.put(10,"10");
        binaryTree.put(25,"25");
        binaryTree.put(16,"16");
        binaryTree.put(23,"23");
        binaryTree.put(26,"26");
        binaryTree.put(6,"6");
        binaryTree.put(9,"9");
        binaryTree.put(14,"14");
        binaryTree.put(17,"17");
        binaryTree.put(12,"12");
        binaryTree.put(13,"13");
        System.out.println("删除前元素个数"+binaryTree.size());

        //测试获取
//        System.out.println(binaryTree.get(13));

        //测试删除
        System.out.println("---------------");
        binaryTree.delete(10);
        int num = 0;
        for (int i = 0;i < 100;i++) {
            String s = binaryTree.get(i);
            if (s != null) {
                System.out.print(s+" ");
                num++;
            }
        }
        System.out.println();
        System.out.println("删除后元素个数"+num);
        System.out.println(binaryTree.size());
        System.out.println(binaryTree.min());
    }

}
